package com.admin.education.dataTransferObject.menus;

import lombok.Data;

import java.util.SortedSet;
import java.util.TreeSet;

@Data
public class MenusTree implements Comparable {
    private  String menuCode;
    private String menuName;
    private int menuOrder;
    private String url;
    private String culture;
    private SortedSet<MenusTree> childrens;
    public MenusTree(){
        childrens = new TreeSet<>();
    }

    @Override
    public int compareTo(Object o) {
        MenusTree menuTree = (MenusTree)o;
        if(null!=menuTree){
            return  this.getMenuOrder()-menuTree.getMenuOrder();
        }
        return 0;
    }
}